VSAE - The "PackageToBundle" task failed unexpectedly

When I reference a MPB file in my MP solution, I get this error when building the MP. I can build once, but every subsequent build fails with this error. I have to close VS and open again, in order to build the MP.

System.IO.IOException: The process cannot access the file 'E:\MP\Microsoft.Linux.RHEL.6.Extended\Microsoft.Linux.RHEL.6.Extended\bin\Debug\Microsoft.Linux.RHEL.6.Extended.mpb' because it is being used by another process.

This only seems to happen if there is a reference to a MPB file. Anyone else see this h

February 12th, 2013 10:44pm

Hi Jonathan,

I have seen this, and many other similar scenarios, where I have to close VS and re-open VS to get it to build correctly.  It does seem as if there are a few bugs outstanding with VSAE, so I try to work in a way that avoids those bugs until an update is released.

Sorry I don't have better news...  maybe someone else has a better story or at least a workaround.

Free Windows Admin Tool Kit Click here and download it now
February 13th, 2013 2:00am

Yeah - that's what I was thinking. I read in another thread recently that there will be an update to VSAE - hopefully it will be coming soon.

Thanks for the reply, David.

February 13th, 2013 5:57am

We haven't seen this internally. Can you share steps that would help us reproduce this issue?

Free Windows Admin Tool Kit Click here and download it now
February 14th, 2013 9:23pm

Hi Marcin,

Here are repro steps:

1. Create new Operations Manager 2012 Add-on MP project.

2. Add reference to management pack bundle. In this case, Microsoft.Linux.RHEL.6.mpb.

3. Add reference to Microsoft.Unix.Library.mp, Microsoft.Linux.Library.mp, and Microsoft.Linux.RedHat.Library.mp.

4. Add new item > empty management pack fragment. Add a discovery like shown in code below.

5. Configure project properties: generate sealed and signed, default MG, and deploy project to default MG only.

6. Build MP (F5 - start debugging).

7. Modify something, like discovery interval.

8. Build MP (F5 - start debugging). Failed: The "PackageToBundle" task failed unexpectedly

Need to close VS and open again to build. Subsequent builds will also result in this error.

<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Monitoring>
    <Discoveries>
      <Discovery ID="repro.OperatingSystem.Discovery" Enabled="true" Target="RHEL6!Microsoft.Linux.RHEL.6.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="RHEL6!Microsoft.Linux.RHEL.6.OperatingSystem" />
        </DiscoveryTypes>
        <DataSource ID="DS" TypeID="Unix!Microsoft.Unix.WSMan.TimedEnumerate.Filtered.ContainSubstring.DiscoveryData">
          <TargetSystem>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
          <Uri>http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx</Uri>
          <Filter />
          <SplitItems>false</SplitItems>
          <Interval>86400</Interval>
          <SyncTime />
          <FilterProperty>/DataItem/WsManData/*[local-name(.)='SCX_OperatingSystem']/*[local-name(.)='Caption']</FilterProperty>
          <FilterValue>Red Hat Enterprise Linux Server release 6.</FilterValue>
          <ClassId>$MPElement[Name="RHEL6!Microsoft.Linux.RHEL.6.OperatingSystem"]$</ClassId>
          <InstanceSettings>
            <Settings>
              <Setting>
                <Name>$MPElement[Name="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Name>
                <Value>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Value>
              </Setting>
              <Setting>
                <Name>$MPElement[Name="Unix!Microsoft.Unix.OperatingSystem"]/OSVersion$</Name>
                <Value>$Data/WsManData/*[local-name(.)='SCX_OperatingSystem']/*[local-name(.)='Version']$</Value>
              </Setting>
              <Setting>
                <Name>$MPElement[Name="Unix!Microsoft.Unix.OperatingSystem"]/OSVersionDisplayName$</Name>
                <Value>$Data/WsManData/*[local-name(.)='SCX_OperatingSystem']/*[local-name(.)='Caption']$</Value>
              </Setting>
              <Setting>
                <Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
                <Value>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Value>
              </Setting>
            </Settings>
          </InstanceSettings>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>  
</ManagementPackFragment>

February 14th, 2013 9:44pm

Which version of Windows are you using on this machine? Are any files used by the project stored on network shares?

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2013 10:48am

Also does it happen if you just build without deploying to a management group?
February 16th, 2013 2:06pm

My experience is that if an attempt has been made to impoprt the MP using e.g. the console, and the import failed, the console retains a handle to the MP preventing Vs from accessing it.  Under these circumstances closing the console frees the file.
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2013 2:15pm

Which version of Windows are you using on this machine? Are any files used by the project stored on network s

February 18th, 2013 9:40pm

Also does it happen if you just build without deploying to a managem
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2013 9:42pm

The only way to get around this issue is by NOT using the deployment feature in VSAE. I just deploy via a powershell task after each build...

Either the Operations Console, Operations Shell, or VS has a handle open on the MPB file, and neither will close the handle. This has been repro'd in every environment I've seen so far.

March 27th, 2013 6:37am

Same problem here.

In fact, I get the same problem if I deploy it via Powershell ISE, so I have to close down Powershell ISE also..

I was hoping this would get better now that I switched from the Authoring Tool to Visual Studio, but no such luck. Until this is fixed I just have to keep closing down the Console and VS for each deployment i try.

Free Windows Admin Tool Kit Click here and download it now
May 26th, 2013 12:43am

Kenneth - I haven't experienced this issue at all by using the Operations Manager Shell and the import-scommanagement pack cmdlet. Don't need to close the shell, either. Try without using the ISE?
May 26th, 2013 6:15am

Same problem here even I don't use the deployment feature. Any solution?
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2014 5:57pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics